package com.gr.staffpm.widget.jqgrid.toolbar;

import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.repeater.RepeatingView;

import com.gr.staffpm.widget.jqgrid.EditableGrid;

public class EditableGridHeadersToolbar<T> extends AbstractEditableGridToolbar<T> {

    private static final long serialVersionUID = 1L;


    public EditableGridHeadersToolbar(final EditableGrid<T> table) {
        super(table);


        RepeatingView headers = new RepeatingView("headers");
        add(headers);

        for (IColumn column : table.getColumns()) {

            WebMarkupContainer item = new WebMarkupContainer(headers.newChildId());
            headers.add(item);
            WebMarkupContainer header = new WebMarkupContainer("header");
            item.add(header);
            item.setRenderBodyOnly(true);
            header.add(column.getHeader("label"));

        }
    }

}
